﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BankImplementation
{
    class Account
    {
        private int accountId;
        private decimal accountMoney;
        private static int accountCounter = 0;

        public int GetId()
        {
            return accountId;
        }

        public Account()
        {
            accountId = ++accountCounter;
        }

        public decimal GetSetMoney
        {
            get
            {
                return accountMoney;
            }
            set
            {
                if (value <= 0)
                {
                    Console.WriteLine("Error");
                }
                else
                {
                    accountMoney += value;
                }
            }
        }

        public decimal GiveMoney
        {
            get
            {
                return accountMoney;
            }
            set
            {
                if (value <= 0)
                {
                    Console.WriteLine("Error");
                }
                else
                {
                    accountMoney -= value;
                }
            }
        }
    }
}
